import bean.BeanA;
import bean.Dog;
import collectionDemo.CollectionType;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author： pang-yun
 * @date： 2021-11-30 10:23
 * 功能目的 : 用于
 */

public class BeanTest {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("spring-config.xml");
//        BeanA beanA = context.getBean("beanA", BeanA.class);
//        beanA.print();
//        context.getBean("animals", Animals.class).printName();
//
//        context.getBean("cat", Cat.class).printName();
//
//        context.getBean("dog", Dog.class).printName();

//


//        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("animals.xml");
//        applicationContext.getBean("dog",Dog.class).printName();
//        System.out.println("4.创建bean");
//        System.out.println(applicationContext.getBean("beanB", BeanA.class));



//        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("collection.xml");
//        System.out.println(applicationContext.getBean("collectionType", CollectionType.class));


        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("animals.xml");
        Dog d = applicationContext.getBean("properties", Dog.class);
        d.printName();
    }
}
